package com.liyuhan.onlinetaxibackground.Controller;

import com.liyuhan.onlinetaxibackground.Service.SMSService;
import com.liyuhan.onlinetaxibackground.dto.DataResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping("/SMS")
public class SMSController {
    @Autowired
    private SMSService smsService;

    @RequestMapping("/registerMessage")
    public DataResponse registerMessage(@Valid @RequestBody String request) {
        // 发送注册验证短信
        return smsService.registerMessage(request);
    }

    @RequestMapping("/loginMessage")
    public DataResponse loginMessaget(@Valid @RequestBody String request) {
        // 发送登录验证短信
        return smsService.loginMessage(request);
    }

    @RequestMapping("/payMessage")
    public DataResponse payMessage(@Valid @RequestBody String request) {
        // 根据订单id订单状态
        return smsService.payMessage(request);
    }
}
